package healththink

import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Forum)
@Mock(Forum)
class ForumTests {

	@Test
	void testForum() {
		Forum target = HealthThink.getStaticForum()
		assertNotNull("(error)Forum Target Null", target)
		assertNotNull("(error)Forum Validation Was Not Successfull", target.validate())

		assertFalse("(error) Forum Has Errors.", target.hasErrors())
		target = target.save(flush:true)
		Forum expected = Forum.findById(target.id)
		
		assertNotNull("(error)Forum Target was not saved", target)
		assertNotNull("(error)Expected Forum was null", expected)
		assertEquals("(error)Target and Expected are not Equal", target, expected)
		   
		target.delete(flush:true)
	}
}
